<template>
    <div class="addBanner">
    <el-input v-model="alt" placeholder="提示信息" :size="20" ></el-input>
    <el-input v-model="link" placeholder="跳转链接" :size="20"></el-input>
    <!-- <el-input v-model="img" hidden placeholder="图片链接"></el-input>
    <el-image :src="img"/> -->
    <el-button type="primary" @click="addBannerFn">添加</el-button>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { addBannerList } from '@/apis/banner';
import { useRouter  } from 'vue-router';
const alt = ref<string>('')
const link = ref<string>('')
const img = ref<string>('')

const bannerImg = ref()
const router = useRouter()
const addBannerFn = () => {
  addBannerList({
    img: img.value,
    alt: alt.value,
    link: link.value
  }).then(() => {
    router.back()
  })
}
</script>

<style scoped>

</style>